package lv.premia.katalogs;


import java.util.ArrayList;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.actionbarsherlock.app.SherlockFragment;
import lv.premia.katalogs.DatabaseManager;


public class Fragment_1 extends SherlockFragment {
	
	/*
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
		return inflater.inflate(R.layout.fragment_1, container, false);
	
	
	
	}
	*/
	public ArrayList<ItemList> items;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){


	    View view = inflater.inflate(R.layout.fragment_1, container, false);
	   // DatabaseManager.init(this);
	    DatabaseManager.getInstance().getAllItemLists();
	     
	 
	    ListView destinationListView = (ListView) view.findViewById(R.id.list_view);

	    ArrayAdapter<ItemList> adapter = new ArrayAdapter<ItemList>(getActivity().getApplicationContext(), android.R.layout.simple_list_item_1, items);
	    destinationListView.setAdapter(adapter);
	        //dbH.close();
	        return view;
	} 
	
} 


